unit ContasReceberFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ComCtrls, ExtCtrls, DBCtrls, StdCtrls, EditBtn, DBGrids, Buttons,
  GerencialMainFr;

type

  { TContasReceberFrame }

  TContasReceberFrame = class(TGerencialMainFrame)
    dataInicial: TDateEdit;
    dataFinal: TDateEdit;
    DBGrid1: TDBGrid;
    Label2: TLabel;
    Label3: TLabel;
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    TipoRadioGroup: TRadioGroup;
    SpeedButton1: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses
  GerencialDM;

{ TContasReceberFrame }

procedure TContasReceberFrame.SpeedButton1Click(Sender: TObject);
begin
  if (dataInicial.Text = '') or (dataFinal.Text = '') then begin
    ShowMessage('Selecione uma Conta');
  end else begin
    if TipoRadioGroup.ItemIndex = 0 then begin
      GerencialData.BuscaContaReceber(dataInicial.Text, dataFinal.Text,
        'T');
    end else if TipoRadioGroup.ItemIndex = 1 then begin
      GerencialData.BuscaContaReceber(dataInicial.Text, dataFinal.Text,
        'A');
    end else begin
      GerencialData.BuscaContaReceber(dataInicial.Text, dataFinal.Text,
        'Q');
    end;
  end;
end;

initialization
  {$I contasreceberfr.lrs}

end.
